<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'name' => 'thanglongco.vn',
    'theme' => 'shop',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool

        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'a',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('127.0.0.1', '::1'),
        ),
        'admin' => array(
            'components' => array(),
        ),
    ),
    // application components
    'components' => array(
        'session' => array(
            'class' => 'CDbHttpSession',
            'connectionID' => 'db',
            'sessionTableName' => 'dbsession',
        ),
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
        ),
        'counter' => array(
            'class' => 'UserCounter',
        ),
        // uncomment the following to enable URLs in path-format
        'urlManager' => require (dirname(__FILE__)) . '/urlManager.php',
//        'db' => array(
//            'connectionString' => 'sqlite:' . dirname(__FILE__) . '/../data/testdrive.db',
//        ),
//        
        // uncomment the following to use a MySQL database
//        'Mailer' => array(
//            'class' => 'ext.PhpMailer.Mailer',
//        ),
//        'db' => array(
//            'connectionString' => 'mysql:host=localhost;dbname=hoangmy_thanglongco',
//            'emulatePrepare' => true,
//            'username' => 'hoangmy_xopen',
//            'password' => 'xopen',
//            'charset' => 'utf8',
//            'tablePrefix' => 'opd_',
//        ),
        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=',
            'emulatePrepare' => true,
            'username' => '',
            'password' => '',
            'charset' => 'utf8',
            'tablePrefix' => 'opd_',
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
            // uncomment the following to show log messages on web pages
            /*
              array(
              'class'=>'CWebLogRoute',
              ),
             */
            ),
        ),
        'settings' => array(
            'class' => 'SiteSettings',
            'cacheComponentId' => 'cache',
            'cacheId' => 'global_website_settings',
            'cacheTime' => 84000,
            'tableName' => '{{settings}}',
            'dbComponentId' => 'db',
            'createTable' => true,
            'dbEngine' => 'InnoDB',
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'adminEmail' => 'dientudienmaythanglong@gmail.com',

        'area' => array(
            'frontend' => 'FRONTEND',
            'admincp' => 'ADMINCP',
        ),
    ),
);
